package com.atguigu.edu.service.impl;

import com.atguigu.edu.entity.Teacher;
import com.atguigu.edu.mapper.TeacherMapper;
import com.atguigu.edu.service.TeacherService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 讲师 服务实现类
 * </p>
 *
 * @author admin
 * @since 2020-06-29
 */
@Service
public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> implements TeacherService {

    //    @Cacheable(key="",value="")
    @Override
    public List<Teacher> getTeacherByLimit4() {
        QueryWrapper<Teacher> wrapper = new QueryWrapper<>();
        wrapper.last("limit 0,4");
        List<Teacher> list = baseMapper.selectList(wrapper);
        wrapper = null;
        return list;
    }
}
